<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>评审页面</title>
    <!--1.引入 bootstrap 框架全局样式 -->
    <link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css"/>
    <!--2.引入 angularJS 分页的样式 -->
    <link rel="stylesheet" href="../angularjs/pagination.css">
    <!--3.引入 jquery 框架类库 -->
    <script src="../bootstrap/js/jquery.min.js"></script>
    <!--4.引入 bootstrap 框架类库 -->
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    <!--5.引入 angularJS 框架类库 -->
    <script src="../angularjs/angular.min.js"></script>
    <!--6.引入 angularJS 框架分页的类库 -->
    <script src="../angularjs/pagination.js"></script>
    <!--7.引入layer css-->
    <link rel="stylesheet" href="https://www.layuicdn.com/layui/css/layui.css">
    <!--8.引入layer js-->
    <script src="https://www.layuicdn.com/layui/layui.js"></script>
    <style>
        span {
            color: red;
        }

        img {
            width: 230px;
            height: 180px;
        }
    </style>
    <script>
        var app = angular.module("FroAloanApp", ['ngCookies']).config(function ($httpProvider) {
            $httpProvider.defaults.useXDomain = true;
            delete $httpProvider.defaults.headers
                .common['X-Requested-With']
        });
        app.controller("FroAloanController", function ($scope, $http, $window, $cookieStore, $element) {
            var token = $window.localStorage.getItem("tokens");
           //定义传到后台的参数
            $scope.staffExmination={};

            $scope.getBorrowerInfo = function () {
                var id = $window.localStorage.getItem("borrowerInfoId");
                var token = $window.localStorage.getItem("tokens");
                $http.post("http://localhost:10088/inspector/getBorrowerInfoBykey?id=" + id,"",{headers: {'auth': token}}).success(function (data) {
                    console.log(data);
                    if (data.code === 200) {
                        $scope.lists = data.data;
                    }
                });
            };
            //提交评审
            $scope.review = function (status) {
                var borrowerInfoId = $window.localStorage.getItem("borrowerInfoId");
                //staffExminationid
                var tsid = $window.localStorage.getItem("tsid");
                $scope.staffExmination.id = tsid;
                $scope.staffExmination.borrowerInfoId = borrowerInfoId;
                $scope.staffExmination.status = status;
                $scope.staffExmination.generalComments = $scope.staffExmination.materialAuthenticityScore+$scope.staffExmination.applicantEvaluation;
                $http.post("http://localhost:10088/inspector/updateStaffExmination",$scope.staffExmination,{headers: {'auth': token}}).success(function (data) {
                    console.log(data);
                    if (data.code === 200) {
                        layer.msg("审批成功");
                        $window.location.href = "myCompletingTask.html";
                    }
                });
            };
            //退出登录
            $scope.logout = function () {
                $window.localStorage.setItem("tokens","");
                $window.location.href = "../admin/login.html";
            };
        });
    </script>
</head>
<body ng-app="FroAloanApp" ng-controller="FroAloanController" ng-init="getBorrowerInfo()">
<div class="navbar navbar-default" >
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">工作人员后台</a>
        </div>
        <ul class="nav navbar-nav">
            <li ><a href="javascript:void(0)" ng-click="toPage('index.html')">任务领取</a></li>
            <li  class="dropdown active">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    我的任务<b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="javascript:void(0)" ng-click="toPage('myCompletingTask.html')">待完成任务</a></li>
                    <li><a href="javascript:void(0)"ng-click="toPage('myCompleteTask.html')">已完成任务</a></li>
                </ul>
            </li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li><a href="#"><span class="glyphicon glyphicon-user"></span>角色: {{rname}}</a></li>
            <li><a href="javascript:void(0)" ng-click="logout()"><span class="glyphicon glyphicon-log-in"></span>注销</a></li>
        </ul>

    </div>

</div>
<div class="container-fluid">
    <div class="panel panel-primary">
        <div class="panel-heading" style="text-align: center">
            <h2>评审页面</h2>
        </div>
        <div class="panel-body">
            <form role="form" name="angularForm">
                <div class="modal-body " id="model-body">
                    <div class="form-group">
                        <div class="row">
                            <div class="col-lg-2">
                                <input type="text" class="form-control" placeholder="请输入真实姓名"
                                       autocomplete="off"
                                       value="{{lists.name}}" readonly>

                            </div>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" autocomplete="off" value="{{lists.idCard}}"
                                       readonly>
                            </div>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" autocomplete="off" value="{{lists.mobile}}"
                                       readonly>
                            </div>

                            <div class="col-lg-2">
                                <div ng-if="lists.sex = 1">
                                    <input type="text" class="form-control" autocomplete="off" value="男" readonly>
                                </div>
                                <div ng-if="lists.sex = 0">
                                    <input type="text" class="form-control" autocomplete="off" value="女" readonly>
                                </div>

                            </div>
                        </div>

                    </div>
                    <div class="form-group">
                        <div class="row">

                            <div class="col-lg-2">
                                <input type="text" class="form-control" autocomplete="off" value="{{lists.education}}"
                                       readonly>
                            </div>
                            <div class="col-lg-2">
                                <input type="text" class="form-control" value="{{lists.postcode}}" autocomplete="off"
                                       readonly>
                            </div>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" value="{{lists.address}}" autocomplete="off"
                                       readonly>
                            </div>
                            <div class="col-lg-2">
                                <div ng-if="lists.isMarry = 1">
                                    <input type="text" class="form-control" value="已婚" autocomplete="off" readonly>
                                </div>
                                <div ng-if="lists.isMarry = 0">
                                    <input type="text" class="form-control" value="未婚" autocomplete="off" readonly>
                                </div>

                            </div>

                        </div>
                    </div>
                    <div class="form-group">
                        <div class="row">
                            <div class="col-lg-2">
                                <input type="text" value="{{lists.enterprise}}" class="form-control" readonly/>
                            </div>
                            <div class="col-lg-3">
                                <input type="text" value="{{lists.enterpriseAddress}}" class="form-control" readonly/>
                            </div>
                            <div class="col-lg-4">
                                <input type="text" value="{{lists.industry}}" class="form-control" readonly/>
                            </div>
                            <div class="col-lg-2">
                                <input type="number" value="{{lists.income}}" class="form-control" readonly/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="row">
                            <div class="col-lg-3">
                                <input type="number" class="form-control" value="{{lists.amount}}" readonly/>
                            </div>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" value="{{lists.returnSource}}" readonly/>
                            </div>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" value="{{lists.bankNo}}" readonly/>
                            </div>
                            <div class="col-lg-2">
                                分期期数:
                                <input type="text" class="form-control" value="{{lists.num}}" readonly/>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="row">
                            <div class="col-lg-3">
                                <input type="text" value="{{lists.contactsName}}" class="form-control" readonly/>
                            </div>
                            <div class="col-lg-3">
                                <input type="text" class="form-control" value="{{lists.contactsMobile}}" readonly/>
                            </div>
                            <div class="col-lg-2">
                                <div ng-if="lists.contactsRelation == 1">
                                    <input type="text" class="form-control" value="父母" readonly/>

                                </div>
                                <div ng-if="lists.contactsRelation == 2">
                                    <input type="text" class="form-control" value="亲戚" readonly/>

                                </div>
                                <div ng-if="lists.contactsRelation == 3">
                                    <input type="text" class="form-control" value="朋友" readonly/>
                                </div>

                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <input class="form-control" value="{{lists.evaluation}}" readonly/>
                    </div>
                    <div class="form-group">
                        <div class="row">
                            <div class="col-lg-3">
                                <img ng-src={{lists.idCardPositive}}>
                            </div>
                            <div class="col-lg-3">
                                <img ng-src={{lists.idCardReverse}}>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label>材料真实性评分1-10</label>
                        <input ng-model="staffExmination.materialAuthenticityScore" type="number" class="form-control">
                    </div>
                    <div class="form-group">
                        <label>申请者评价评分1-10</label>
                        <input ng-model="staffExmination.applicantEvaluation" type="number" class="form-control">
                    </div>
                    <div class="form-group">
                        <label>评审意见</label>
                        <input ng-model="staffExmination.approvalComments" type="text" class="form-control">
                    </div>

                </div>
                <div class="modal-footer">
                    <div class="form-group">
                        <div class="row">
                            <div class="col-lg-6">
                                <button type="button" class="btn btn-primary form-control" value="通过评审" ng-click="review(1)">通过评审
                                </button>
                            </div>
                            <div class="col-lg-6">
                                <button type="button" class="btn btn-primary form-control" value="驳回评审" ng-click="review(-1)">驳回评审
                                </button>
                            </div>
                        </div>

                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>